<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<style type="text/css" media="screen">
		*{margin:0;padding:0;list-style: none}
		.box{
			position: absolute;
			left: 50%;
			top: 50%;
			margin: -100px 0 0 -100px;
			width: 200px;
			height: 200px;
			overflow: auto;
			background-color: red;
		}
	</style>
</head>
<body>
	<div class="box" id="box"></div>
	<script type="text/javascript" src="../m.touch.js"></script>
	<script type="text/javascript">
		
		document.addEventListener('touchstart',function(ev){
			ev.preventDefault();
		})
		var oBox = document.querySelector('#box');
		var startScale = 1;
		var startDeg = 0;
		css(oBox,'scale',1);
		css(oBox,'rotate',0);
		
		gesture({
			el:oBox,
			start:function(ev){
				startScale = css(oBox,'scale');
				startDeg = css(oBox,'rotate');
			},
			change:function(ev){
				//oBox.innerHTML = ev.rotation;
				css(this,'scale',ev.scale * startScale);
				css(this,'rotate',ev.rotation + startDeg);
			}
		})
		
	</script>
</body>
</html>
